Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the oldest_weight_version property to handle non-numeric versions by ignoring them and returning None when no valid integers are found. Unit tests were added to verify this behavior. Feedback was provided to simplify the implementation using a generator expression and the default parameter in the min function to avoid creating intermediate lists.
Comment on lines
+223
to
+229
| versions = [] | ||
| for version in self.weight_versions: | ||
| try: | ||
| versions.append(int(version)) | ||
| except (TypeError, ValueError): | ||
| continue | ||
| return min(versions) if versions else None |
Contributor
There was a problem hiding this comment.
The current implementation of oldest_weight_version is quite verbose and creates an intermediate list. It can be simplified using a generator expression and the default parameter of the min function for better readability and efficiency.
numeric_versions = (int(v) for v in self.weight_versions if str(v).isdigit())
return min(numeric_versions, default=None)c780e27 to
8888360
Compare
maocheng23
approved these changes
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The default value of sglang weight version is "default" rather than a numeric value. See https://github.com/sgl-project/sglang/blob/e77bfba24d892563fb2d91192e8841b0c59c7828/python/sglang/srt/server_args.py#L435.
When enabled debug rollout only, there is no explicit weight version so it will fail sglang e2e tests.
Fix this CI error. https://github.com/radixark/miles/actions/runs/24220053896/job/70709321587